<?php
// 后台共用导航栏
if (empty($_SESSION['user_id'])) {
    header('Location: login.php');
    exit;
}
?>
<nav style="background: #343a40; padding: 15px; margin-bottom: 20px;">
    <div style="width: 1200px; margin: 0 auto; display: flex; gap: 20px;">
        <a href="article.php" style="color: white; text-decoration: none; padding: 8px 12px; border-radius: 4px;">文章管理</a>
        <a href="user.php" style="color: white; text-decoration: none; padding: 8px 12px; border-radius: 4px;">用户管理</a>
        <a href="version.php" style="color: white; text-decoration: none; padding: 8px 12px; border-radius: 4px;">版本管理</a>
        <div style="margin-left: auto;">
            <span style="color: #ddd; margin-right: 15px;">当前登录：<?php echo $_SESSION['username']; ?></span>
            <a href="logout.php" style="color: #ffc107; text-decoration: none;">退出登录</a>
        </div>
    </div>
</nav>